/*
 * @name: **列表
 * @content:
 * @Author: joyce
 * @Date: 2020-05-20 16:49:01
 */

var mongoose = require("mongoose");

//商品表(commodity)

var commoditySchema = new mongoose.Schema({
  status: { type: Boolean, required: true, default: true }, //商品状态
  title: { type: String, required: true }, //标题
  details: { type: String, required: true }, //详情
  integral: { type: Number, required: true }, //积分
  textimg: { type: Array, required: true }, //图文信息
  mainimg: { type: Array, required: true }, //主图
  stock: { type: Number, required: true }, //库存
  categoryindex: { type: String, required: true }, //商品类别索引
  labelindex: { type: String, required: true }, //商品标签索引
  create_time: { type: Date, required: true } //创建时间
});

module.exports = mongoose.model("commodity", commoditySchema);
